Page({
  data: {
    index: 0,
    multiArray: [['轿车', '跑车','SUV','MPV','面包','皮卡','卡车','客车'], ['微型轿车', '小型轿车', '紧凑型轿车', '中级轿车', '中高级轿车','高级轿车','豪华轿车']],
    objectMultiArray: [
      [
        {
          id: 0,
          name: '轿车'
        },
        {
          id: 1,
          name: '跑车'
        },
        {
          id: 2,
          name: 'SUV'
        },
        {
          id: 3,
          name: 'MPV'
        },
        {
          id: 4,
          name: '面包'
        },
        {
          id: 5,
          name: '皮卡'
        },
        {
          id: 6,
          name: '卡车'
        },
        {
          id: 7,
          name: '客车'
        }
      ], [
        {
          id: 0,
          name: '微型轿车'
        },
        {
          id: 1,
          name: '小型轿车'
        },
        {
          id: 2,
          name: '紧凑型轿车'
        },
        {
          id: 3,
          name: '中级轿车'
        },{
          id: 4,
          name: '中高级轿车'
        },{
          id: 5,
          name: '高级轿车'
        },,{
          id: 6,
          name: '豪华轿车'
        },
      ]
    ],
    multiIndex: [0, 0],
    
    customItem: '全部',
  },
  bindPickerChange: function(e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      index: e.detail.value
    })
  },
  bindMultiPickerChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      multiIndex: e.detail.value
    })
  },
  bindMultiPickerColumnChange: function (e) {
    console.log('修改的列为', e.detail.column, '，值为', e.detail.value);
    var data = {
      multiArray: this.data.multiArray,
      multiIndex: this.data.multiIndex
    };
    data.multiIndex[e.detail.column] = e.detail.value;
    switch (e.detail.column) {
      case 0:
        switch (data.multiIndex[0]) {
          case 0:
            data.multiArray[1] = ['微型轿车', '小型轿车', '紧凑型轿车', '中级轿车', '中高级轿车','高级轿车','豪华轿车'];
            break;
          case 1:
            data.multiArray[1] = ['普通跑车', '中级跑车', '高级跑车','豪华跑车','超级跑车'];
            break;
          case 2:
            data.multiArray[1] = ['微型SUV','轻型SUV','小型SUV','中型SUV','大型SUV','豪华SUV','专业SUV','紧凑型SUV'];
          case 3:
            data.multiArray[1] = ['小型MPV','普通MPV','中高级MPV','豪华MPV'];
          case 4:
            data.multiArray[1] = ['微型面包车','普通面包车','中高级面包车','豪华面包车'];
          case 5:
            data.multiArray[1] = ['低档卡车','中档卡车','高档卡车','超级卡车'];
          case 6:
            data.multiArray[1] = ['小卡','轻卡','中卡','重卡','专用车'];
          case 7:
            data.multiArray[1] = ['中巴车','城市客车','长途客车'];
        }
        data.multiIndex[1] = 0;
        data.multiIndex[2] = 0;
        break;
      
        
        data.multiIndex[2] = 0;
        break;
    }
    console.log(data.multiIndex);
    this.setData(data);
  },
  onChange({ detail }) {
    // 需要手动对 checked 状态进行更新
    this.setData({ checked: detail });
  },
  onLoad: function (options) {
  },
  //点击我显示底部弹出框
  clickme: function () {
    this.showModal();
  },

  //显示对话框
  showModal: function () {
    // 显示遮罩层
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(300).step()
    this.setData({
      animationData: animation.export(),
      showModalStatus: true
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export()
      })
    }.bind(this), 200)
  },
  //隐藏对话框
  hideModal: function () {
    // 隐藏遮罩层
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(300).step()
    this.setData({
      animationData: animation.export(),
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export(),
        showModalStatus: false
      })
    }.bind(this), 200)
  }


})
